<template>
  <div class="app">
    <!-- PDF显示的地方 -->
    <iframe ref="pdf" :src="previewUrl" width="100%"></iframe>
  </div>
</template>
<script>
// import axios from "axios";
// import router from "@/router";
export default {
  name: "PDF",
  data() {
    return {
      previewShow: false,
      previewUrl: "",
    };
  },
  created() {
    this.previewUrl = this.$route.query.address;
    // this.previewUrl = "https://wylovezgq.top/images/logomark.png";
    // console.log(router.history.current.query.addres);
    console.log(this.previewUrl);
  },
  methods: {
    // 直接传入一个地址
    preview1() {
      this.previewShow = true;
      this.$nextTick(() => {
        this.$refs.pdf.height = document.documentElement.clientHeight;
      });
    },
  },
  mounted() {
    this.preview1();
  },
};
</script>
<style scoped></style>
